	// TextInput 文本输入
	var TextInput=function(selector){
		this.selector=selector;
	}
	TextInput.prototype=new Control();
	TextInput.prototype.optionList=null;
	TextInput.prototype.init=function(){
		var list2=$(this.selector).prop("list");
		var name=$(this.selector).attr("name");
		var selects=$("select[name='"+name+"']");
		
		if(typeof list2=="string"){
		}else{
			if(list2!=null){
				$(selects).remove();
				return ;
			}
		}
		var list=$(this.selector).attr("list");
		
		var parent=this.selector.parent()
		var self=this;
		if(typeof list != "undefined"){
			if(selects.length>0){
				$(this.selector).remove();
				$(selects).show();
			}
		}
		//$(this.selector).bind("input",function(event){self.inputHandler(event)})
	}
	TextInput.prototype.init=function(){
		var listName=$(this.selector).prop("list");
		
		var self=this;
		
		if(typeof listName!="undefined" && listName!=null){
			//console.log(listName);
			$(self.selector).bind("change",function(event){
				$(self.selector).blur();
			})
			$(self.selector).bind("focus",function(event){
				//console.log("focus");
				var target=event.currentTarget
				var sourceValue=$(target).val();
				
				$(target).val("");
				if(sourceValue!="" && typeof sourceValue!="undefined"){
					$(target).attr("data-source-value",sourceValue);
				}
			})
			$(self.selector).bind("blur",function(event){
				//console.log("blur");
				var target=event.currentTarget;
				
				var value=$(target).val();
				var sourceValue=$(target).attr("data-source-value");
				
				//console.log(1)
				//console.log(value);
				//console.log(sourceValue);
				//console.log(2)
				if(value=="" || typeof value=="undefined"){
					//console.log(3);
					if(sourceValue!="" && typeof sourceValue!="undefined"){
						//console.log(4);
						$(target).val(sourceValue);
					}
				}
			})
		}
	}
	TextInput.prototype.inputHandler=function(event){
		var target=event.currentTarget;
		var value=target.value;
		console.log(value);
	}
	HTMLTurbo.control.TextInput=TextInput;